$OpenBSD: patch-libtiff_tif_compress_c,v 1.4 2012/04/14 15:09:55 naddy Exp $
--- libtiff/tif_compress.c.orig	Wed Apr 11 18:23:56 2012
+++ libtiff/tif_compress.c	Wed Apr 11 18:25:07 2012
@@ -201,14 +201,15 @@ TIFFFindCODEC(uint16 scheme)
 TIFFCodec*
 TIFFRegisterCODEC(uint16 scheme, const char* name, TIFFInitMethod init)
 {
+	size_t namelen = strlen(name);
 	codec_t* cd = (codec_t*)
-	    _TIFFmalloc((tmsize_t)(sizeof (codec_t) + sizeof (TIFFCodec) + strlen(name)+1));
+	    _TIFFmalloc((tmsize_t)(sizeof (codec_t) + sizeof (TIFFCodec) + namelen+1));
 
 	if (cd != NULL) {
 		cd->info = (TIFFCodec*) ((uint8*) cd + sizeof (codec_t));
 		cd->info->name = (char*)
 		    ((uint8*) cd->info + sizeof (TIFFCodec));
-		strcpy(cd->info->name, name);
+		strlcpy(cd->info->name, name, namelen+1);
 		cd->info->scheme = scheme;
 		cd->info->init = init;
 		cd->next = registeredCODECS;
